
<form class="form-horizontal" role="form" method="post">
  {% csrf_token %}
  <div class="form-group">
    <label for="name" class="col-sm-2 control-label">{{ form.fields.name.label }}</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="name" name="name" placeholder="{{ form.fields.name.help_text }}" value="{{ category.name }}">
      {% if form.name.errors %}
        {% for error in form.name.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>
  <div class="form-group">
    <label for="description" class="col-sm-2 control-label">{{ form.fields.description.label }}</label>
    <div class="col-sm-10">
      <textarea class="form-control" id="description" name="description" placeholder="{{ form.fields.description.help_text }}">{{ category.description }}</textarea>
      {% if form.description.errors %}
        {% for error in form.description.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">提交</button>
    </div>
  </div>
</form>